<%@ page language="java" import="com.demo.util.Conn,java.sql.ResultSet" pageEncoding="UTF-8"%>

<%
String user_id = session.getAttribute("user_id").toString();
String sql = "select * from dbf_stuuser where STUUSER_ID=" + user_id;

ResultSet rs = new Conn().find(sql);
rs.next();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>基本信息</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<link rel="stylesheet" type="text/css" href="../style.css">
  </head>
  
  <body>
  <table width="718" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="39" colspan="3" background="../images/main_title.jpg"><strong>&nbsp;&nbsp;&nbsp;&nbsp;<span class="menutitle">&nbsp;General Information</span></strong></td>
    </tr>
    <tr>
      <td valign="bottom"><img src="../images/menu_a.jpg" width="19" height="23" /></td>
      <td valign="top">&nbsp;</td>
      <td valign="bottom"><img src="../images/menu_b.jpg" width="18" height="23" /></td>
    </tr>
    <tr>
      <td width="19" valign="top" background="../images/menu_c.jpg"><img src="../images/menu_c.jpg" width="19" height="54" /></td>
      <td width="681" valign="top"><form action="doupdateinfo.jsp" method="post">
	  	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="logintxt">
	  		<tr>
	  			<td colspan="2">Name:&nbsp;</td>
	  			<td width="20%" align="left"><input name="name" type="text" class="logintxt" style="width:150px;" value="<%=rs.getString("name")==null ? "" : rs.getString("name") %>"/></td>
	  			<td width="40%" align="right">Sex:&nbsp;</td>
	  			<td colspan="2" align="left"><input name="sex" type="text" class="logintxt" style="width:150px;" value="<%=rs.getString("sex")==null ? "" : rs.getString("sex") %>"/></td>
  			</tr>
	  		<tr>
	  			<td colspan="2">Birthday:&nbsp;</td>
	  			<td width="20%" align="left"><input type="text" name="birthday" value="<%=rs.getString("birthday")==null ? "" : rs.getString("birthday") %>" style="width:150px;"/></td>
	  			<td width="40%" align="right">Home address:&nbsp;</td>
	  			<td colspan="2" align="left"><input type="text" name="address" value="<%=rs.getString("address")==null ? "" : rs.getString("address") %>" style="width:150px;"/></td>
  			</tr>
	  		<tr>
	  			<td colspan="2">Phone number:&nbsp;</td>
	  			<td width="20%" align="left"><input type="text" name="phone" value="<%=rs.getString("CONTACT_PHONE")==null ? "" : rs.getString("CONTACT_PHONE") %>" style="width:150px;"/></td>
	  			<td width="40%" align="right">Email address:&nbsp;</td>
	  			<td colspan="2" align="left"><input type="text" name="email" value="<%=rs.getString("email")==null ? "" : rs.getString("email") %>" style="width:150px;"/></td>
  			</tr>
  			<tr>
	  			<td colspan="2">Student number:&nbsp;</td>
	  			<td width="20%" align="left"><input type="text" name="stuno" value="<%=rs.getString("stuno")==null ? "" : rs.getString("stuno") %>" style="width:150px;"/></td>
	  			<td width="40%" align="right">&nbsp;</td>
	  			<td colspan="2" align="left">&nbsp;</td>
  			</tr>
	  		<tr>
	  			<td colspan="2">My picture:&nbsp;</td>
	  			<td width="20%" align="left" colspan="4">
	  				<%
	  					String picFile = rs.getString("pic_file");
	  					if (!"".equals(picFile) && picFile != null) {
	  				%>
	  					<img src="getpic.jsp?fn=<%=rs.getString("pic_file") %>" alt="My picture" width="160" height="190" border="0" />
	  				<%} %>
	  				&nbsp;&nbsp;&nbsp;<a href="uploadPic.jsp">Upload</a>	  			</td>
	  		</tr>
	  		<tr><td height="15" colspan="6" style="color:red;text-align:center">&nbsp;</td></tr>
	  		<tr>
	  			<td width="10%">&nbsp;</td>
	  			<td width="40%" align="right" colspan="2">&nbsp;</td>
	  			<td width="40%" align="left" colspan="2"><input name="submit" type="image" src="../images/submit_btn.jpg" value="update" /></td>
	  			<td width="10%">&nbsp;</td>
	  		</tr>
	    </table>
    </form></td>
      <td width="18" valign="top" background="../images/menu_d.jpg"><img src="../images/menu_d.jpg" width="18" height="54" /></td>
    </tr>
    <tr>
      <td><img src="../images/menu_e.jpg" width="19" height="25" /></td>
      <td background="../images/menu_f.jpg"><img src="../images/menu_f.jpg" width="181" height="25" /></td>
      <td><img src="../images/menu_g.jpg" width="18" height="25" /></td>
    </tr>
  </table>
  </body>
</html>
